//
//  UILabel+Extension.swift
//  Weibo
//
//  Created by 周先生 on 15/11/14.
//  Copyright © 2015年 周先生. All rights reserved.
//

import UIKit

extension UILabel {

    //参数指定默认值 该参数可以不传
    convenience init(title: String, size: CGFloat, color: UIColor, margin: CGFloat = 0) {
        self.init()
        text = title
        textAlignment = NSTextAlignment.Center
        font = UIFont.systemFontOfSize(size)
        textColor = color
        numberOfLines = 0
        if margin != 0 {
        preferredMaxLayoutWidth = screenW - 2 * margin
            textAlignment = .Left
        
        }
        sizeToFit()
    }
    



}